package huizhi.exercise;

import cn.hutool.core.util.StrUtil;

public class SplicingStrings {
    /**
     * CQA-91-99999
     * CQA-91-01111
     *
     * CQA-NE15-00009
     * CQA-NE15-00010
     * CQA-NE15-00011
     * CQA-NE15-00012
     * CQA-NE15-00013
     * CQA-NE15-00014
     *
     * CQA-NE14/15-00003
     * CQA-NE14/15-00004
     *
     * REP-20201203-0006
     * REP-20201203-0007
     * REP-20201203-0006
     * @param args
     */

    public static void main(String[] args) {
        //CQA-NE15-0000
        //传入两个参数 模板和累加
//        splicing("REP-20201203-","0006");
        String str1 = "REP-20201203-0006";
        String str2 = "REP-20201203-";
        splicing2(str1,str2,4,1);
    }
    private static void splicing2(String str1,String str2,int length,int bc){
        int a = str2.length();
        String substring = str1.substring(0,a);
        substring+="{}";
        for (int i = 1; i <20; i++) {
            String s = String.format("%0"+length+"d",i);
            System.out.println(StrUtil.format(substring, s));
        }

    }
}
